/* 苹果风格基础样式 */
:root {
    --apple-blue: #0071e3;
    --apple-light-gray: #f5f5f7;
    --apple-dark-gray: #1d1d1f;
    --apple-border-radius: 12px;
}

body.apple-style {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--apple-light-gray);
    color: var(--apple-dark-gray);
    line-height: 1.5;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.editor-container {
    background: white;
    border-radius: var(--apple-border-radius);
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

h1 {
    font-weight: 600;
    font-size: 32px;
    margin-bottom: 30px;
    color: var(--apple-dark-gray);
}

.form-group {
    margin-bottom: 25px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 17px;
}

input[type="text"] {
    width: 100%;
    padding: 12px 15px;
    font-size: 17px;
    border: 1px solid #d2d2d7;
    border-radius: var(--apple-border-radius);
    transition: border-color 0.3s;
}

input[type="text"]:focus {
    border-color: var(--apple-blue);
    outline: none;
}

.apple-button {
    background-color: var(--apple-blue);
    color: white;
    border: none;
    border-radius: 980px;
    padding: 12px 22px;
    font-size: 17px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    z-index: 10;
}

.apple-button:hover {
    background-color: #0077ed;
    transform: scale(1.02);
}

#editor {
    border: 1px solid #d2d2d7;
    border-radius: var(--apple-border-radius);
    overflow: hidden;
}

/* tui.editor自定义样式 */
.tui-editor-defaultUI {
    border-radius: var(--apple-border-radius) !important;
}

.tui-editor-defaultUI .te-mode-switch-section {
    border-radius: var(--apple-border-radius) var(--apple-border-radius) 0 0 !important;
}body:not(.apple-style) {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    color: #333;
    background-color: #ffffff;
}

.posts {
    margin-top: 2rem;
}

.post-preview {
    margin-bottom: 2rem;
    padding: 20px;
    border-radius: var(--apple-border-radius);
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s;
}

.post-preview:hover {
    transform: translateY(-2px);
}

time {
    color: #86868b;
    font-size: 0.9em;
    display: block;
    margin: 0.5rem 0;
}

.content {
    margin-top: 2rem;
}

/* 博客头部样式 */
.blog-header {
    background: linear-gradient(135deg, #0071e3 0%, #004e9e 100%);
    color: white;
    padding: 2rem 0;
    margin-bottom: 3rem;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.blog-header h1 {
    font-size: 2.5rem;
    font-weight: 600;
    margin: 0;
    color: white;
}

.blog-header nav {
    display: flex;
    gap: 1rem;
}

/* 博客内容容器 */
.blog-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* 文章网格布局 */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

/* 文章卡片样式 */
.post-card {
    background: white;
    border-radius: var(--apple-border-radius);
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s, box-shadow 0.3s;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.post-meta {
    display: flex;
    justify-content: space-between;
    color: #86868b;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.post-card h2 {
    font-size: 1.5rem;
    margin: 0 0 1rem 0;
    color: var(--apple-dark-gray);
}

.post-card h2 a {
    color: inherit;
    text-decoration: none;
}

.post-excerpt {
    color: #515154;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.read-more {
    color: var(--apple-blue);
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.read-more i {
    margin-left: 0.5rem;
    transition: transform 0.3s;
}

.read-more:hover i {
    transform: translateX(3px);
}

/* 管理界面样式 */
.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.posts-management {
    display: grid;
    gap: 1.5rem;
    margin-top: 2rem;
}

.post-management-card {
    background: white;
    border-radius: var(--apple-border-radius);
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.3s, box-shadow 0.3s;
    margin-bottom: 1rem;
}

.post-management-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.post-management-card .apple-button {
    transition: all 0.3s;
}

.post-management-card .apple-button:hover {
    transform: scale(1.05);
}

.post-management-card .apple-button.danger:hover {
    transform: scale(1.05);
    background-color: #ff453a;
}

.post-info h3 {
    margin: 0 0 0.5rem 0;
    color: var(--apple-dark-gray);
}

.post-actions {
    display: flex;
    gap: 1rem;
}

.apple-button.danger {
    background-color: #ff3b30;
}

.apple-button.danger:hover {
    background-color: #ff453a;
}

/* 博客页脚 */
.blog-footer {
    text-align: center;
    padding: 2rem;
    color: #86868b;
    font-size: 0.9rem;
}

/* 登录页面样式 */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
    padding: 2rem;
}

.login-card {
    background: white;
    border-radius: var(--apple-border-radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    padding: 2.5rem;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header i {
    font-size: 2.5rem;
    color: var(--apple-blue);
    margin-bottom: 1rem;
}

.login-header h1 {
    font-size: 1.8rem;
    margin: 0;
    color: var(--apple-dark-gray);
}

.login-form .form-group {
    margin-bottom: 1.5rem;
}

.login-form label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--apple-dark-gray);
}

.login-form input {
    width: 100%;
    padding: 12px 15px;
    font-size: 1rem;
    border: 1px solid #d2d2d7;
    border-radius: var(--apple-border-radius);
    transition: border-color 0.3s;
}

.login-form input:focus {
    border-color: var(--apple-blue);
    outline: none;
}

.alert {
    padding: 12px;
    border-radius: var(--apple-border-radius);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.alert-error {
    background-color: #ffebee;
    color: #c62828;
}

.alert-success {
    background-color: #e8f5e9;
    color: #2e7d32;
}

/* 编辑器页面样式 */
.editor-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.editor-form {
    background: white;
    border-radius: var(--apple-border-radius);
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.editor-form .form-group {
    margin-bottom: 2rem;
}

.editor-form label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    margin-bottom: 0.8rem;
    color: var(--apple-dark-gray);
}

.editor-form input {
    width: 100%;
    padding: 12px 15px;
    font-size: 1rem;
    border: 1px solid #d2d2d7;
    border-radius: var(--apple-border-radius);
    transition: border-color 0.3s;
}

.editor-form input:focus {
    border-color: var(--apple-blue);
    outline: none;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

/* tui.editor自定义样式 */
.tui-editor-defaultUI {
    border-radius: var(--apple-border-radius) !important;
    border: 1px solid #d2d2d7 !important;
}

.tui-editor-defaultUI .te-mode-switch-section {
    border-radius: var(--apple-border-radius) var(--apple-border-radius) 0 0 !important;
    background-color: #f5f5f7 !important;
}

.tui-editor-defaultUI .te-switch-button {
    color: #86868b !important;
}

.tui-editor-defaultUI .te-switch-button.active {
    color: var(--apple-blue) !important;
}

.tui-editor-defaultUI .te-toolbar-section {
    border-bottom: 1px solid #f0f0f0 !important;
}

.tui-editor-defaultUI .te-editor-section .te-preview {
    padding: 20px !important;
}

/* 搜索框样式 */
.search-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.search-box {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 30px;
    padding: 8px 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s;
}

.search-box:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.search-box input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1rem;
    padding: 8px;
    background: transparent;
}

.search-box button {
    background: none;
    border: none;
    color: var(--apple-blue);
    cursor: pointer;
    font-size: 1.2rem;
}

.search-results {
    position: absolute;
    width: 100%;
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

/* 动态背景 */
.animated-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.particle {
    position: absolute;
    border-radius: 50%;
    background: rgba(0,113,227,0.1);
    pointer-events: none;
}

.particle:nth-child(1) {
    width: 300px;
    height: 300px;
    top: 20%;
    left: 10%;
    background: radial-gradient(circle, rgba(0,113,227,0.1) 0%, transparent 70%);
    filter: blur(30px);
    data-speed: "5";
}

.particle:nth-child(2) {
    width: 200px;
    height: 200px;
    top: 60%;
    left: 70%;
    background: radial-gradient(circle, rgba(0,113,227,0.08) 0%, transparent 70%);
    filter: blur(20px);
    data-speed: "3";
}

.particle:nth-child(3) {
    width: 150px;
    height: 150px;
    top: 30%;
    left: 50%;
    background: radial-gradient(circle, rgba(0,113,227,0.05) 0%, transparent 70%);
    filter: blur(15px);
    data-speed: "2";
}

/* 卡片悬停动画 */
.post-card {
    transition: transform 0.3s, box-shadow 0.3s;
}

.post-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 15px 30px rgba(0,0,0,0.15) !important;
}

/* 全局主题设置 */
body {
    position: relative;
    min-height: 100vh;
    transition: all 0.3s ease;
}

.apple-style {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

/* 深色主题样式 */
.dark-theme.apple-style {
    background: linear-gradient(135deg, #2c3e50 0%, #1a1a2e 100%);
}

/* 深色主题样式 */
.anime-style.dark-theme {
    background: linear-gradient(135deg, #2c3e50 0%, #1a1a2e 100%);
}

.anime-style.dark-theme .anime-bg::before {
    opacity: 0.2;
    mix-blend-mode: multiply;
}

.theme-switcher {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.anime-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, #a1c4fd 0%, #c2e9fb 100%);
    z-index: -2;
}

.anime-bg::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('https://img.freepik.com/free-vector/cute-anime-girl-pattern-background-pink-watercolor_53876-117364.jpg');
    background-size: cover;
    background-position: center;
    opacity: 0.4;
    z-index: -1;
    mix-blend-mode: overlay;
}

.post-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2.5rem;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    margin-top: 3rem;
    margin-bottom: 3rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.dark-theme .post-container,
.dark-theme .blog-container,
.dark-theme .admin-container {
    background-color: rgba(30, 30, 40, 0.95);
    border: 1px solid rgba(60, 60, 70, 0.5);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    color: #e0e0e0;
}

.post-container::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 70%);
    z-index: -1;
}

.post-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.post-header h1 {
    font-size: 2.2rem;
    margin-bottom: 1rem;
    color: #333;
    transition: color 0.3s;
}

.dark-theme .post-header h1,
.dark-theme .blog-header h1,
.dark-theme .post-info h3 {
    color: #ffffff;
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 1.5rem;
    background: rgba(255, 255, 255, 0.7);
    padding: 1.2rem;
    border-radius: 12px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
}

.dark-theme .post-meta,
.dark-theme .search-box {
    background: rgba(50, 50, 60, 0.7);
    border: 1px solid rgba(80, 80, 90, 0.3);
    color: #e0e0e0;
}

.dark-theme .search-box input {
    color: #e0e0e0;
    background: transparent;
}

.dark-theme .search-box input::placeholder {
    color: #a0a0a0;
}

.dark-theme .meta-item {
    background: rgba(60, 60, 70, 0.8);
    color: #ffffff;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    transition: all 0.3s;
}

.meta-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 113, 227, 0.1);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.meta-item i {
    color: var(--apple-blue);
    transition: color 0.3s;
}

.dark-theme .meta-item i,
.dark-theme .apple-button {
    color: #4da6ff;
}

.dark-theme .apple-button {
    background: rgba(60, 60, 70, 0.7);
    border: 1px solid rgba(80, 80, 90, 0.5);
}

.dark-theme .apple-button.danger {
    background: rgba(100, 30, 30, 0.7);
    border: 1px solid rgba(120, 40, 40, 0.5);
}

.dark-theme .apple-button.danger:hover {
    background: rgba(120, 40, 40, 0.7);
}

/* 图片上传区域 */
.image-upload-container {
    margin: 1rem 0;
    padding: 1rem;
    border: 2px dashed rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    transition: all 0.3s;
}

.dark-theme .image-upload-container {
    border-color: rgba(255, 255, 255, 0.2);
}

.image-upload-container:hover {
    border-color: var(--apple-blue);
}

#image-upload {
    display: block;
    margin-bottom: 1rem;
}

.image-preview {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.image-preview img {
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.image-preview img:hover {
    transform: scale(1.05);
}

/* 文章内容图片样式 */
.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5rem auto;
    display: block;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.post-content img:hover {
    transform: scale(1.02);
}

/* 图片说明文字 */
.post-content img + em {
    display: block;
    text-align: center;
    font-size: 0.9rem;
    color: #666;
    margin-top: -1rem;
    margin-bottom: 1.5rem;
}

.dark-theme .post-content img + em {
    color: #aaa;
}

/* 响应式图片 */
@media (max-width: 768px) {
    .post-content img {
        margin: 1rem auto;
    }
}

/* 顶部导航栏 */
.top-navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 60px;
}

.admin-quick-actions {
    display: flex;
    gap: 1rem;
}

.apple-button.small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.dark-theme .top-navbar {
    background: rgba(30, 30, 40, 0.97);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.3);
}

.theme-switcher {
    height: 100%;
    display: flex;
    align-items: center;
}

.admin-quick-actions {
    height: 100%;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.apple-button.small {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
}

.dark-theme .page-header {
    background: rgba(30, 30, 40, 0.9);
}

.admin-quick-actions {
    display: flex;
    gap: 0.8rem;
}

/* 侧边栏布局 */
.post-layout {
    display: flex;
    max-width: 100%;
    margin: 0;
    gap: 2rem;
}

.sidebar {
    width: 20%;
    position: fixed;
    left: 0;
    top: 60px; /* 导航栏高度 */
    bottom: 0;
    overflow-y: auto;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.9);
    border-right: 1px solid rgba(0, 0, 0, 0.1);
}

.dark-theme .sidebar {
    background: rgba(30, 30, 40, 0.9);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.post-container {
    margin-left: 20%;
    width: 80%;
    padding: 2rem;
    margin-top: 60px; /* 导航栏高度 */
}

/* 响应式布局 */
@media (max-width: 992px) {
    .sidebar {
        width: 30%;
    }
    .post-container {
        margin-left: 30%;
        width: 70%;
    }
}

@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .sidebar {
        position: static;
        width: 100%;
        border-right: none;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    }

    .post-container {
        margin-left: 0;
        width: 100%;
    }

    .admin-quick-actions {
        flex-wrap: wrap;
        justify-content: center;
    }
}

.dark-theme .apple-button:hover {
    background: rgba(80, 80, 90, 0.7);
}

.dark-theme .blog-footer {
    color: #a0a0a0;
}

.content {
    line-height: 1.9;
    font-size: 1.15rem;
    color: #333;
    position: relative;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    margin-top: 2rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
}

.dark-theme .content,
.dark-theme .post-card,
.dark-theme .post-management-card {
    color: #e0e0e0;
    background: rgba(40, 40, 50, 0.8);
    border: 1px solid rgba(80, 80, 90, 0.3);
}

.content::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.3) 0%, transparent 100%);
    z-index: -1;
    border-radius: 12px;
}

.content p {
    margin-bottom: 1.5rem;
}

.content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    margin: 1.5rem 0;
    transition: transform 0.3s;
}

.content img:hover {
    transform: scale(1.02);
}

.post-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    text-align: center;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .posts-grid {
        grid-template-columns: 1fr;
    }

    .login-card {
        padding: 1.5rem;
    }
}

a {
    color: var(--apple-blue);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
    opacity: 0.9;
}